from django.contrib import admin
from django.apps import apps
from django.http import HttpResponse
from django.urls import path

# Register your models here.
from .models import *

apps.get_app_config('Data').verbose_name = '职位数据模块'

# Django 一个Model 不能被注册成两个ModelAdmin   --> 估计为了是ORM映射数据库安全吧
# 所以要创建一个新的类，去继承实现


# 职位数据
class JobDataAdmin(admin.ModelAdmin):
    list_display = ['job_name', 'language', 'job_degree', 'salary_desc', 'brand_name', 'scope', 'stage', 'city_name',
                    'area_district', 'data_from']

    search_fields = ['job_name']  # 搜索过滤
    list_filter = ['language', 'job_degree', 'city_name']  # 条件过滤


admin.site.register(JobModel, JobDataAdmin)


class JobCalAdmin(admin.ModelAdmin):
    list_display = ['job', 'average_salary']


admin.site.register(JobCal, JobCalAdmin)
